<%
# Copyright (C) 2013 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
%>

<div class="discussion-section discussion-assignment-section alert alert-info">
  <div class="row-fluid">
    <div class="span6">
      <p class="discussion-title">
        <%= t('graded_discussion_and_points',
              { :one => 'This is a graded discussion: *1 point possible*',
                :other => 'This is a graded discussion: *%{count} points possible*' },
              :count => round_if_whole(@assignment.points_possible) || 0,
              :wrapper => "<span class='discussion-points'>\\1</span>") %>
      </p>
    </div>

    <div class="span6 right-align">
      <div class="discussion-pubdate">
        <% if @assignment.has_active_overrides? && @presenter.can_grade?  %>
          <a href="#" class="toggle_due_dates">{{#t}}Show Due Dates{{/t}}</a>

        <% else %>
          <b <%= context_sensitive_datetime_title(@assignment.due_at, @assignment.context) %> >
            <%= t(:due_date, 'due %{date}', :date => OverrideListPresenter.new.due_at(@assignment)) %>
          </b>
        <% end %>
      </div>
    </div>
  </div>

  <% if @presenter.can_grade? %>
    <div class="row-fluid">
      <div class="span12 hidden due_date_wrapper">
        <table class="discussion-topic-due-dates">
          <thead>
            <tr>
              <th scope="col">{{#t}}Due{{/t}}</th>
              <th scope="col">{{#t}}For{{/t}}</th>
              <th scope="col">{{#t}}Available from{{/t}}</th>
              <th scope="col">{{#t}}Until{{/t}}</th>
            </tr>
          </thead>

          <%= render 'shared/override_list', :assignment => @assignment,
            :user => @current_user %>

        </table>
      </div>
    </div>
  <% end %>

</div>
